function check_for_empty() {
    $(document).ready(function(){
        $post_row = $('#post_table tr').length - 1;
        $reject_row = $('#reject_table tr').length - 1;
        $pending_row = $('#pending_table tr').length - 1;
        $draft_row = $('#draft_table tr').length - 1;
        $trash_row = $('#trash_table tr').length - 1;
        
        $bulletin_div = $('#bulletin_post > div').length;
        if($post_row === 0) {
            $('#post_table').append('<tr><td class="auto_generated_td">Empty</td><td class="auto_generated_td">Empty</td><td class="auto_generated_td">Empty</td><td class="auto_generated_td">Empty</td><td class="auto_generated_td">Empty</td><td class="auto_generated_td">Empty</td></tr>');
            $('#post_table').css({'margin-bottom' : '200px'});
        }
        if($reject_row === 0) {
            $('#reject_table').append('<tr><td class="auto_generated_td">Empty</td><td class="auto_generated_td">Empty</td><td class="auto_generated_td">Empty</td><td class="auto_generated_td">Empty</td></tr>');
            $('#reject_table').css({'margin-bottom' : '200px'});
        }
        if($pending_row === 0) {
            $('#pending_table').append('<tr><td class="auto_generated_td">Empty</td><td class="auto_generated_td">Empty</td><td class="auto_generated_td">Empty</td><td class="auto_generated_td">Empty</td><td class="auto_generated_td">Empty</td></tr>');
            $('#pending_table').css({'margin-bottom' : '200px'});
        }
        if($draft_row === 0) {
            $('#draft_table').append('<tr><td class="auto_generated_td">Empty</td><td class="auto_generated_td">Empty</td><td class="auto_generated_td">Empty</td><td class="auto_generated_td">Empty</td></tr>');
            $('#draft_table').css({'margin-bottom' : '200px'});
        }
        if($trash_row === 0) {
            $('#trash_table').append('<tr><td class="auto_generated_td">Empty</td><td class="auto_generated_td">Empty</td><td class="auto_generated_td">Empty</td><td class="auto_generated_td">Empty</td></tr>');
            $('#trash_table').css({'margin-bottom' : '200px'});
        }
//        if($bulletin_div === 0) {
//            $('#bulletin_post').append('<div class="post"><img src="resources/images/sad_face.jpg" alt="X" /><p class="result_none">Sorry :(</p><p class="result_none">Search result 0</p></div>');
//       
//            $('.post').css({
//                'background':'#ffffff',
//                'height':'250px'
//            });
//            $('.result_none').css({
//                'font-size':'30px',
//                'text-align':'center'
//            });
//        }
    });
}

function destination_onchange () {
        var destination = document.getElementById('create_post_destination');
        var group = document.getElementById('group');
        var samp = document.getElementById('sample');
        var hey = document.getElementById('hey');
        var temp = destination.value.split(",");
        if(temp[1] === "grp") {
            /*group.style.visibility = 'visible';*/
            samp.style.display = 'block';

        } else{
            /*group.style.visibility = 'hidden';*/
            samp.style.display = 'none';
        }
}
//$(document).ready(function(){
//    $('.year').click(function(){
//        /*var year = $(this).text();
//        $('#months_'+year).slideToggle('slow');*/
//        window.location.href = "/scis-info-board/authenticated/group_post/subscribed/" + $(this).text();
//    });
//});

function validate_new_pass(){
    new_pass = $('#new_pass').val();
    conf_pass = $('#conf_pass').val();
    if(new_pass !== conf_pass) {
        $('#no_match').css({'visibility':'visible'});
    }else{
        $('#no_match').css({'visibility':'hidden'});
    }
}

$(document).ready(function(){
    if ($('#message_container').text() === "") {
        $('#message_container').css('visibility','hidden');
    }
});